import 'package:flutter/material.dart';

class MyApp13 extends StatelessWidget {
  const MyApp13({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('ListView的基本使用'),
        backgroundColor: const Color.fromARGB(255, 232, 221, 10),
      ),
      body: Container(
        padding: EdgeInsets.all(10),
        child: ListView(
          // 滚动效果：禁用滚动
          // physics: const NeverScrollableScrollPhysics(),
          // 滚动方向1：纵向滚动(默认的)
          scrollDirection: Axis.vertical,
          // 滚动方向2：横向滚动
          // scrollDirection: Axis.horizontal,
          children: [
            Container(
              height: 80,
              color: Colors.blue,
              alignment: Alignment.centerLeft,
              child: const Text('鸿蒙大事件1'),
            ),
            Container(
              height: 90,
              color: Colors.pink,
              alignment: Alignment.centerLeft,
              child: const Text('鸿蒙大事件2'),
            ),
            Container(
              height: 100,
              color: Colors.teal,
              alignment: Alignment.centerLeft,
              child: const Text('鸿蒙大事件3'),
            ),
            Container(
              height: 110,
              color: Colors.green,
              alignment: Alignment.centerLeft,
              child: const Text('鸿蒙大事件4'),
            ),
            Container(
              height: 120,
              color: Colors.cyan,
              alignment: Alignment.centerLeft,
              child: const Text('鸿蒙大事件5'),
            ),
            Container(
              height: 130,
              color: Colors.orange,
              alignment: Alignment.centerLeft,
              child: const Text('鸿蒙大事件6'),
            ),
            Container(
              height: 140,
              color: Colors.blue,
              alignment: Alignment.centerLeft,
              child: const Text('鸿蒙大事件7'),
            ),
            Container(
              height: 150,
              color: Colors.green,
              alignment: Alignment.centerLeft,
              child: const Text('鸿蒙大事件8'),
            ),
            Container(
              height: 160,
              color: Colors.red,
              alignment: Alignment.centerLeft,
              child: const Text('鸿蒙大事件9'),
            ),
          ],
        ),
      ),
    );
  }
}
